Skip to content

Fix crash caused by negative waveform.#461

Merged
brettviren merged 1 commit into
WireCell:masterfrom
hgreenlee:master
Apr 22, 2026
Merged

Fix crash caused by negative waveform.#461
brettviren merged 1 commit into
WireCell:masterfrom
hgreenlee:master

Conversation

@hgreenlee
Copy link
Copy Markdown

No description provided.

@brettviren
Copy link
Copy Markdown
Member

Setting a negative float to an unsigned int is undefined behavior in C++.

It is better that we find out why negative signals are produced and fix the problem there and/or explicitly set a negative signal to zero perhaps with a single warning log message.

@hgreenlee
Copy link
Copy Markdown
Author

OK, I modified the merge branch to test for negative values.

@brettviren
Copy link
Copy Markdown
Member

If I understand, the fix to larwirecell will hide this problem, but this protection is still good so I'll merge.

Here's the larwirecell PR for future reference LArSoft/larwirecell#65

@brettviren brettviren merged commit e7d4ef2 into WireCell:master Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants